# -*- coding: utf-8 -*-

import unittest
from wolfox.foxit.source.filestore import CSVStore

TEST_FILE = 'fstest.txt'
class CSVStoreTest(unittest.TestCase):
    def tearDown(self):
        try:
            import os
            os.remove(TEST_FILE)
        except Exception:  #init测试中这个文件未创建
            pass

    def test_init(self):
        fs = CSVStore()    
        self.assertTrue(True)

    def test_open_close(self):
        fs = CSVStore()
        fs.open(TEST_FILE)
        fs.close()

    def test_save(self):
        fs = CSVStore()
        fs.open(TEST_FILE)
        fs.save(['filestore save test','next line'])
        fs.close()


if __name__ == "__main__":
    unittest.main()

